import request from '@/utils/request'

export function getCategory() {
  return request({
    url: '/goods/category/getCategory',
    method: 'get'
  })
}

export function getCategoryGoods(categoryId) {
  return request({
    url: '/goods/category/getGoods/' + categoryId,
    method: 'get'
  })
}

export function updateCategory(data) {
  return request({
    url: '/goods/category/update',
    method: 'post',
    data
  })
}

export function addCategory(data) {
  return request({
    url: '/goods/category/add',
    method: 'post',
    data
  })
}

export function delCategory(categoryId) {
  return request({
    url: '/goods/category/del?categoryId=' + categoryId,
    method: 'get'
  })
}